package cn.edu.scau.cmi.wujiaxian.client;

import java.util.Scanner;

import cn.edu.scau.cmi.wujiaxian.factory.BeefFactory;
import cn.edu.scau.cmi.wujiaxian.factory.MeatFactory;
import cn.edu.scau.cmi.wujiaxian.factory.PorkFactory;
import cn.edu.scau.cmi.wujiaxian.simpleFactoryMethod.domain.Meat;

public class FactoryClient {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		System.out.println("Please select which kind of meat you want to eat: beef or pork???");
		Scanner scanner = new Scanner(System.in);
		String meatKind = scanner.next();
		MeatFactory meatFactory = null;
		switch (meatKind) {
		case "beef":
			meatFactory = new BeefFactory();
			break;
		case "pork":
			meatFactory = new PorkFactory();
			break;
		default:
			System.out.println("sorry, your input is not correct");
		}
		if (meatFactory != null) {
			Meat meat = meatFactory.getMeat();
			meat.cook();
		}
	}
}